package appconfig

import (
	"fmt"
	"github.com/mattermost/viper"
)

type AppConfig struct {
	JWTConfig
	RealNameConfig
	AlipayConfig
}

type JWTConfig struct {
	AccessSecret string
	AccessExpire int
}
type RealNameConfig struct {
	SecretId  string
	SecretKey string
}
type AlipayConfig struct {
	PrivateKey string
	AppId      string
}

var AppConf AppConfig

func InitAppConfig() {
	viper.SetConfigFile("./appconfig/test.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("配置失败")
		return
	}

	viper.Unmarshal(&AppConf)
	fmt.Println(AppConf, 11111)
}
